﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RssMenuInput.ascx.cs" Inherits="admin_webparts_Plug_ins_RssNews_RssMenuInput" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<%@ Import Namespace="NTTHAO.Web.BL.Rss" %>
<form id="frmInput" runat="server" onsubmit="return doSubmit();">
<%
    string bUrl = "?type=" + Request.QueryString["type"] + "&name=" + Request.QueryString["name"] + "&item=" + Request.QueryString["item"] + "&g=" + Request.QueryString["g"];
    bool isAdmin = Context.User.Identity.Name.Equals("admin", StringComparison.OrdinalIgnoreCase);
    int langID = LanguageUtility.GetLanguageID();
    int siteID = WebGlobal.GetSite().ID;
    string actionName = "Thêm menu RSS";
    if ("editmenu".Equals(Request.QueryString["action"], StringComparison.OrdinalIgnoreCase))
    {
        actionName = "Sửa thông tin menu RSS";
    }
%>
<script type="text/javascript">
function doSubmit() {
    var txtMenuText = document.getElementById("<%=this.txtMenuText.ClientID %>");
    var errorMessage = "";
    
    errorMessage = CheckFieldString("noblank", txtMenuText, 'Vui lòng nhập tên menu liên kết RSS');
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtMenuText.select();
        txtMenuText.focus();
        return false;
    }
    
    return true;
}
</script>
<div class="tip" style="position: relative;">
	<h1 style="left: 0px; position: relative;">Nhập menu tin tức RSS</h1>
	<div style="display: block; width: 32px; height: 32px; float: right; position: absolute; top: 5px; right: 5px;"><a title="Click vào đây để quay lại." href="<%=bUrl %>"><img alt="Back" src="resources/images/Back.png" /></a></div>
</div>
<div class="path border" style="margin-bottom: 10px; overflow: hidden;">
    <span class="name" style="float: left;"><%=_Group.Name %><span class="sepa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><div style="float: left; display: inline;"><%
    RssMenu menu = _Menu;
    while (menu != null)
    {
%><span class="name" style="float: right;"><%=menu.Text%><span class="sepa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><%
        menu = RssMenu.GetRssMenu(menu.ParentID);
    } 
%></div><span style="float: left;"><%=actionName %></span>
</div>
<div style="text-align: left;">
    <span id="spSave" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel1" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="<%=bUrl %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave", function () {
            var spSave = new YAHOO.widget.Button("spSave");
        });
        YAHOO.util.Event.onContentReady("spCancel1", function () {
            var spCancel1 = new YAHOO.widget.Button("spCancel1");
        });
    </script>
</div>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("MENU_TEXT", Session)%><span style="color: #ff0000;">&nbsp;*</span>
        </td>
        <td>
            <asp:TextBox ID="txtMenuText" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<p style="text-align: left;">
    <span id="spSave2" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave2" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="<%=bUrl %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave2", function () {
            var spSave2 = new YAHOO.widget.Button("spSave2");
        });
        YAHOO.util.Event.onContentReady("spCancel2", function () {
            var spCancel2 = new YAHOO.widget.Button("spCancel2");
        });
        document.getElementById('<%=this.txtMenuText.ClientID %>').focus();
    </script>
</p>
</form>